package id_gen

import (
	"github.com/sony/sonyflake"
	"time"
)

var (
	client *sonyflake.Sonyflake
)

func Init() {
	client = sonyflake.NewSonyflake(sonyflake.Settings{
		StartTime: time.Time{},
		MachineID: func() (uint16, error) {
			return 1, nil
		},
	})
}

func Get() (uint64, error) {
	return client.NextID()
}
